import React, { Component } from 'react';
import Header from '../../../components/Header/Header';
import { connect } from "react-redux";
import { Toast } from 'react-weui';
import * as actions from '../../../store/action/my';
import '../../../static/css/common.less';
import './about.less';

class About extends Component {
    componentWillMount(){
        //因为在此进行了订阅，所以以后如果仓库中的状态发生改变的话就会让组件重新渲染
        this.props.fetchAbout();
    }

    render() {
        return (
            <div>
                <Toast icon="loading" show={this.props.my.fetching}>Loading...</Toast>
                <div className="detail-region">
                    <Header title="关于"></Header>
                    <section className="content">
                        <img className="bg-pic" src={require('../../../static/images2/login-bg.png')}></img>
                        <div className="content-detail">{this.props.my.content}</div>
                        <div className="version">版本号1.0.0</div>
                    </section>
                </div>
            </div>
        )
    }
}

//把组件和store关联在一起
export default connect((state)=>{return {...state}}, actions)(About);